//
//  StackViewViewController.swift
//  XMenSwift
//
//  Created by Jason on 2023/7/13.
//

import UIKit

class StackViewViewController: BaseViewController {
    
//    lazy var horizontalStackView: UIStackView = {
//        let view = UIStackView()
//        view.axis = .horizontal
//        view.distribution = .fill
//        view.spacing = 10
//        view.alignment = .center
//        return view
//    }()
    
    lazy var verticalStackView: UIStackView = {
        let view = UIStackView()
        view.axis = .vertical
        view.distribution = .fill
        view.spacing = 10
        view.alignment = .center
        return view
    }()
    
    lazy var imageV: UIImageView = {
        let view = UIImageView()
        view.contentMode = .scaleAspectFill
        view.layer.masksToBounds = true
        view.image = UIImage(named: "售后icon_del")
        return view
    }()
    
    lazy var descLabelA: UILabel = {
        let label = UILabel()
        label.textColor = UIColor.blue
        label.numberOfLines = 1
        label.textAlignment = .left
        label.text = "dejakdjaksjdejakdjaksjdejakdjaksjdejakdjaksjdejakdjaksjdejakdjaksj"
        return label
    }()
    
    lazy var descLabelB: UILabel = {
        let label = UILabel()
        label.textColor = UIColor.blue
        label.numberOfLines = 1
        label.textAlignment = .left
        label.text = "666666666666666666666666666666666666666666666666666666"
        return label
    }()
    lazy var descLabelC: UILabel = {
        let label = UILabel()
        label.textColor = UIColor.blue
        label.numberOfLines = 1
        label.textAlignment = .left
        label.text = "999999999999999999999999999999999999999999999999999999"
        return label
    }()
    
    lazy var titleLabel: UILabel = {
        let label = UILabel()
        label.textColor = UIColor.blue
        label.numberOfLines = 1
        label.textAlignment = .left
        label.text = "这是title这是title这是title这是title这是title"
        return label
    }()

    override func viewDidLoad() {
        super.viewDidLoad()

//        self.view.addSubview(horizontalStackView)
//        horizontalStackView.snp.makeConstraints { make in
//            make.left.top.right.equalToSuperview()
//            make.height.equalTo(60)
//        }
//        horizontalStackView.addArrangedSubview(imageV)
//        imageV.snp.makeConstraints { make in
//            make.width.height.equalTo(40)
//        }
//        horizontalStackView.addArrangedSubview(titleLabel)
//        horizontalStackView.addArrangedSubview(descLabelA)
//        horizontalStackView.addArrangedSubview(descLabelB)
//        horizontalStackView.addArrangedSubview(descLabelC)
//        horizontalStackView.setCustomSpacing(30, after: descLabelA)
        
        self.view.addSubview(verticalStackView)
        verticalStackView.snp.makeConstraints { make in
            make.left.top.right.equalToSuperview()
//            make.height.equalTo(60)
        }
        verticalStackView.addArrangedSubview(imageV)
        imageV.snp.makeConstraints { make in
            make.width.height.equalTo(40)
        }
        verticalStackView.addArrangedSubview(titleLabel)
        verticalStackView.addArrangedSubview(descLabelA)
        verticalStackView.addArrangedSubview(descLabelB)
        verticalStackView.addArrangedSubview(descLabelC)
        verticalStackView.setCustomSpacing(30, after: descLabelA)
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
